package com.badibadi.adapter;

import java.util.List;

import com.badibadi.mytools.InterestModel;
import com.badibadi.uniclubber.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;


public class ListTypeAdapter extends BaseAdapter{
	List<InterestModel> lists;
	Context context;
	public ListTypeAdapter(Context context,List<InterestModel> list)
	{
		this.context=context;
		lists=list;
	}
	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return lists.size();
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return lists.get(position);
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return Long.parseLong(lists.get(position).getId());
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
	
		LayoutInflater inflater=LayoutInflater.from(context);
		convertView=inflater.inflate(R.layout.list_adapteritem, null);
		TextView item=(TextView)convertView.findViewById(R.id.item);
		item.setText(""+lists.get(position).getName());
		
		return convertView;
	}

}
